package com.digigraphic.searchengine.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.digigraphic.entity.Article;
import com.digigraphic.mapper.SearchEngineMapper;
import com.digigraphic.searchengine.dao.SearchEngineDAO;

@Component
public class SearchEngineDAOImpl implements SearchEngineDAO{

	private SearchEngineMapper sem;



	public SearchEngineMapper getSem() {
		return sem;
	}

	@Resource
	public void setSem(SearchEngineMapper sem) {
		this.sem = sem;
	}

	public List<Article> getSETitle(int beginRow,int endRow,String condition) {
		List<Article> semList = sem.getSETitle(beginRow,endRow,condition);
		for (int i = 0; i < semList.size(); i++) {
			Article a = new Article();
			a = semList.get(i);
			a.setDtlActionName("searchengineDtl");
		}
		return semList;
	}

	public List<Article> getSEContext(int articleid, String tbName) {
		List<Article> semList = sem.getSEContext(articleid, tbName);
		return semList;
	}

	public int getTotalResultCount(String condition) {
		
		int resultCount = sem.getTotalResultCount(condition);
		
		return resultCount;
	}

	
}
